//
//  EntityModelFactory.m
//  TengineTwo
//
//  Created by StandardUser on 10/02/2012.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "EntityModelFactory.h"
#import "EntityModel.h"
#import "GhostModule.h"
#import "BulletModule.h"
#import "PlayerModule.h"

@implementation EntityModelFactory

+(EntityModel*)createFromType:(EntityType)type
{
    EntityModel *e = [[[EntityModel alloc] initWithType:type] autorelease];
    switch (type) {
        case GHOST:
            e.updater = [[[GhostModule alloc] init] autorelease];
            e.speed = 20;
            break;
        case BULLET:
            e.updater = [[[BulletModule alloc] init] autorelease];
            e.speed = 20;
            break;
        case PLAYER:
            e.updater = [[[PlayerModule alloc] init] autorelease];
            e.speed = 1;
        default:
            NSLog(@"no entity model created for type:%i", type);
    }
    
    return e;
}

@end
